<template>
  <div class="main">
    <div class="Breadcrumb">

    </div>
    <el-tabs v-model="activeName" >
      <el-tab-pane label="用户管理" name="first">


        <el-table :data="tableData" style="width: 100%">
          <el-table-column label="unid" width="333">
            <template slot-scope="scope">
              <span style="margin-left: 10px">{{ scope.row.unid }}</span>
            </template>
          </el-table-column>

          <el-table-column label="用户名"  width="333">
            <template slot-scope="scope">
              <el-popover trigger="hover" placement="top">
                <div slot="reference" class="name-wrapper">
               {{ scope.row.username }}
                </div>
              </el-popover>
            </template>
          </el-table-column>

          <el-table-column label="昵称" width="333">
            <template slot-scope="scope">
              <el-popover trigger="hover" placement="top">
                <div slot="reference" class="name-wrapper">
                  {{ scope.row.nickname }}
                </div>
              </el-popover>
            </template>
          </el-table-column>

          <el-table-column label="vip等级" width="333">
            <template slot-scope="scope">
              <el-popover trigger="hover" placement="top">
                <div slot="reference" class="name-wrapper">
                  {{ scope.row.vipLevel }}
                </div>
              </el-popover>
            </template>
          </el-table-column>

          <el-table-column label="操作"  width="333">
            <template slot-scope="scope">
              <el-button
                size="mini"
                @click="handleEdit(scope.$index, scope.row)"
                >编辑</el-button>
              <el-button
                size="mini"
                type="danger"
                @click="handleDelete(scope.$index, scope.row)"
                >删除</el-button
              >
            </template>
          </el-table-column>
        </el-table>
      </el-tab-pane>

      <el-tab-pane label="配置管理" name="second">角色管理</el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
  import * as api from "@/api/users";
export default {
  meta:{
      title:'yhgl',
      name:'用户管理',
      icon:"iconfont icon-yonghu"
  },
  data() {
    return {
      activeName: "first",
      tableData: [],
    };
  },
  methods: {
    getAllusers(){
      api.getAllusersApi()
      .then(res =>{
        this.tableData=res.data.data
        console.log(this.tableData);
      })
    }
  },
  created () {
    this.getAllusers()
  }
};
</script>
<style lang="less" scoped>
#app {
    .layout-container {
      .el-container {
        .is-vertical {
          .el-main {
            .main {
              line-height: 14px;
              font-size: 14px;
              text-align: left;
              .Breadcrumb {
                margin: 20px 0 30px 0;
                .Breadcrumb__item:nth-of-type(1) {
                  font-weight: 900;
                }
                .Breadcrumb__item:nth-of-type(1):hover{
                  cursor: pointer;
                  color:skyblue
                }
              }
             /deep/ .el-tabs{
                .el-tabs__content{
                  .el-tab-pane{
                    .el-table__cell{
                      text-align: center;
                      .el-button--default{
                        width: 70px;
                        height: 40px;
                        font-size: 14px;
                        background-color: #409eff;
                        color:#fff
                      }
                      .el-button--danger{
                        width: 70px;
                        height: 40px;
                        font-size: 14px;
                        color:#fff
                      }
                    }
                    
                  }
                }
              }
            }
          }
        }
      }
    }
}
</style>